<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<body>
<div></div>
<script>

  test(function () {

    var div = document.querySelector("div");
    var clickEvent = null;

    div.addEventListener("click", function (ev) { clickEvent = ev; });
    div.click();

    assert_not_equals(clickEvent, null, "click event captured");

    var getter_called = false;
    var setter_called = false;

    Object.defineProperty(Array.prototype, "0", {
      get: function () { getter_called = true; },
      set: function () { setter_called = true; }
    });

    var path = clickEvent.path;

    delete Array.prototype["0"];

    assert_false(getter_called, "Array.prototype[0] getter called");
    assert_false(setter_called, "Array.prototype[0] setter called");

    assert_equals(clickEvent.path.length, 5, "click event path length");

  }, "conversion should use [[DefineOwnProperty]]");

</script>
</body>
